import request from "@/utils/axios";

// 密码登录
export function LoginByPwd(data = {}) {
  return request.post("/auth-backend/login/captcha", data, { headers: { isToken: false } });
}

// 验证码登录
export function LoginByCode(data = {}) {
  return request.post("/auth-backend/login/smsLogin", data, { headers: { isToken: false } });
}

// 忘记密码
export function ForgetPass(data = {}) {
  return request.post("/auth-backend/user/forgetPass", data, { headers: { isToken: false } });
}

// 获取验证码图片（如果是图片流，按需加 responseType: 'blob'）
export function GetCodeImg() {
  return request.get("/support-backend/captcha/generate", {}, { headers: { isToken: false } });
}

// 发送短信验证码
export function SendSms(data = {}) {
  return request.post("/auth-backend/sms/send", data, { headers: { isToken: false } });
}

// 发送短信类型
export function SendType() {
  return request.get("/auth-backend/sms/sendType", {}, { headers: { isToken: false } });
}

// 根据登录手机号返回客户列表
export function GetCustomersByPhone(data = {}) {
  return request.post("/auth-backend/login/customers", data);
}

// 选择用户
export function LoginChooseUser(data = {}) {
  return request.post("/auth-backend/login/chooseUser", data);
}

// 商家入驻
export function UserRegister(data = {}) {
  return request.post("/auth-backend/user/register", data);
}

// 修改手机号
export function ChangePhone(data = {}) {
  return request.post("/auth-backend/user/changePhone", data);
}

/**修改手机号发送短信验证码*/
export function SendModifyMobile(data = {}) {
  return request.post("/auth-backend/sms/sendModifyMobile", data);
}
